Skip to content

fix(record): retry unparsable L1 extraction output#190

Open
RerankerGuo wants to merge 1 commit into
TencentCloud:mainfrom
RerankerGuo:fix/l1-extraction-parse-retry
Open

fix(record): retry unparsable L1 extraction output#190
RerankerGuo wants to merge 1 commit into
TencentCloud:mainfrom
RerankerGuo:fix/l1-extraction-parse-retry

Conversation

@RerankerGuo

Copy link
Copy Markdown
Contributor

Description | 描述

Retry L1 extraction once when the model returns output that cannot be parsed as the required JSON array.

  • Keeps valid empty extraction results ([]) as-is and does not retry them.
  • Reuses the same extraction prompt with an additional retry instruction that asks for JSON only.
  • Adds focused coverage for parse-failure retry success and for not retrying a valid empty array.

Related Issue | 关联 Issue

Fix #115

Change Type | 修改类型

  • Bug fix | Bug 修复
  • New feature | 新功能
  • Documentation update | 文档更新
  • Code optimization | 代码优化

Self-test Checklist | 自测清单

  • Verified locally | 本地验证通过
  • No existing features affected | 无影响现有功能

Additional Notes | 其他说明

Verified with npx vitest run src/core/record/l1-extractor.test.ts, npm test, and npm run build using Node v24.15.0.

@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

Retrying on parse failure is a pragmatic improvement for L1 extraction reliability. We appreciate the care taken to not retry valid empty results. We'll review it internally.

Signed-off-by: Ziyang Guo <121015044+RerankerGuo@users.noreply.github.com>
@RerankerGuo RerankerGuo force-pushed the fix/l1-extraction-parse-retry branch from 5595963 to d120268 Compare July 8, 2026 07:49

@YOMXXX YOMXXX left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after local verification. This is the canonical #115 fix for retrying unparsable L1 extraction output once while preserving valid empty [] responses.

Verified locally:

  • COREPACK_ENABLE_AUTO_PIN=0 pnpm vitest run src/core/record/l1-extractor.test.ts
  • COREPACK_ENABLE_AUTO_PIN=0 pnpm test
  • COREPACK_ENABLE_AUTO_PIN=0 pnpm build
  • git diff --check

Note: local Node is v22.14.0 while package.json wants >=22.16.0, so pnpm prints an engine warning, but all commands passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: seed command fails silently — L1 extraction JSON parse errors, L2/L3 timer conflicts, no retry

3 participants